package com.southwind.servise;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.southwind.entity.Account;
import com.southwind.mdao.AccountMapper;

@Service
public class AccountService {

	@Autowired
	AccountMapper mapper;
	
		// 新增
		public int save(Account account) {
			return mapper.save(account);
			
		}

		// 修改
		public int update(Account account) {
			return mapper.update(account);
			
		}

		// 根据编号删除
		public int deleteById(long id) {
			return mapper.deleteById(id);
			
		}

		// 查询所有的account
		public List<Account> findAll(){
			return mapper.findAll();
			
		}

		// 根据编号查询
		public Account findById(long id) {
			return mapper.findById(id);
			
		}
		//根据编号查姓名
		public String findNameById(long id) {
			return mapper.findNameById(id);
			
		}

}
